/**
 * Copyright (C), 2020-2020,贵州铭明网络科技有限公司
 * FileName: Application
 * Author:   杨朝湖
 * Date:     2020/11/26 12:10
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.mm;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import tk.mybatis.spring.annotation.MapperScan;

import javax.servlet.MultipartConfigElement;

/**
 * 〈一句话功能简述〉<br>
 * 〈系统启动类〉
 *
 * @author Gym
 * @create 2020/11/26
 * @since 1.0.0
 */
@SpringBootApplication
@MapperScan(basePackages = "com.mm.mapper")
public class ApplicationSystem {
    /**
     * 启动
     *
     * @param args
     */
    public static void main(String[] args) {
        SpringApplication.run(ApplicationSystem.class, args);
    }

    /**
     * 配置文件上传大小
     *
     * @return
     */
    @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        factory.setLocation("/tmp");
        // 文件最大
        factory.setMaxFileSize("1024MB"); // KB,MB
        /// 设置总上传数据总大小
        factory.setMaxRequestSize("1024MB");
        return factory.createMultipartConfig();
    }

}